<template>
  <div class="Shop_list">
    <Shop_item v-for="(item, index) in shop_list_content" :ShopInfo="item" :key="index"></Shop_item>
  </div>
</template>

<script>
  import Shop_item from '@/components/Shop_item.vue'
  export default {
    name: "Shop_list",
    data() {
      return {
        shop_list_content: [],
      }
    },
    created() {
      console.log(this.getUrl)
      //获取附近商家列表信息
      this.axios.get(this.getUrl)
        .then((res) => {
          this.shop_list_content = res.data;
          console.log(res.data)
        }).catch((err) => {
          console.log(err);
        })
    },
    props: ["getUrl"],

    components: {
      Shop_item,
    },
    watch: {
      getUrl(newV) {
        this.axios.get(newV)
          .then((res) => {
            this.shop_list_content = res.data;
            console.log(res.data)
          }).catch((err) => {
            console.log(err);
          })
      }
    },
  }
</script>

<style lang="less">
  .Shop_list {
    margin-top: 20px;
  }
</style>